//
//  SEGInviteViewModel.m
//  SEGViewModel
//
//  Created by 山刘 on 2020/5/28.
//

#import "SEGInviteViewModel.h"

@implementation SEGInviteViewModel
#pragma mark - business
-(void)requestShareEntryInfo:(void(^)(NSString* codeType,NSString* errorMessage))completed{
    [self.inviteManager requestShareEntryInfo:^(BOOL isSuccessed,id result,NSString* codeType,NSString* errorMessage) {
        if ([codeType isEqualToString:@"0"]) {
            self.inviteModel = self.inviteManager.inviteModel;
            self.inviteModel.inviteurl = [SEGPlatformManager getUrlStringWithAppPlatformCode:self.inviteModel.inviteurl];
        }
        completed(codeType,errorMessage);
    }];
}
-(void)requestSubmitShareQcodeWithShareCode:(NSString*)shareCode paperId:(NSString*)paperId channel:(NSString*)channel{
    [self.inviteManager requestSubmitShareQcodeWithShareCode:shareCode paperId:paperId channel:channel finished:^(BOOL isSuccessed,id result,NSString* codeType,NSString* errorMessage) {
    }];
}
#pragma mark - getter
- (SEGInviteManager *)inviteManager
{
    if (!_inviteManager) {
        _inviteManager = [[SEGInviteManager alloc] init];
    }
    return _inviteManager;
}
@end
